#ifndef GAME_H
#define GAME_H

#include "utilities.h"
#include "entitymanager.h"
#include <QThread>
#include <QList>
#include <QPoint>

class Server;

class Game
{
public:
   Game();
   virtual ~Game();

   //static Game* instance();
   PathType path();
   //Entity::EntityListType addEntitySquad(const quint32 playerID, const quint32 squadID, const EntityBaseStats &stats, quint32 squadSize, QPointF &pos);
   Entity* addEntity(const quint32 playerID, const EntityBaseStats &stats, QPointF &pos);
   bool addEntity(Entity *entity);
   void removeInactiveEntities();
   void squadKilled(const quint32 squadID);
   //void postEvent(Event *event);
   //EventListType& events();
   QTime currentTime();

   QString currentMap();
   void setCurrentMap(const QString &filename);

   EntityManager entityManager;

   void entityDoDamage(Entity *attacker, Entity *target, const qint32 amount);

   Server *server;
   void tick(qreal timeDelta);
   PathType path(const QString &pathname);

private:
   //Game(); // singleton
   //static Game *gInstance;

   void parseMapFile(const QString &filename);
   //void buildPath(QImage *mapdata, const QPoint &p, const PIXEL_DIRECTION_TYPE &ignoreDir);

   PathListType mPaths;
   //EventListType mEvents;
   QString mCurrentMap;
};

#endif // GAME_H
